/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TaskManager.java
 *
 * Created on 2009-7-14, 22:53:07
 */

package spyware;

import java.util.ArrayList;

import javax.swing.DefaultListModel;
import javax.swing.ListModel;

/**
 *
 * @author macitu
 */
public class TaskManager extends javax.swing.JFrame {

    DefaultListModel listOfProc;
    public TaskManager(ArrayList<String> listofproc){
    	this.listOfProc = new DefaultListModel();
    	for(String proc:listofproc){
        	listOfProc.addElement(proc);
        }
        initComponents();
        
    }
    /** Creates new form TaskManager */
    public TaskManager() {
    	this.listOfProc = new DefaultListModel();
        initComponents();
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainpanel = new javax.swing.JScrollPane();
        list = new javax.swing.JList();

        //setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Running Processes");
        
        list.setBackground(new java.awt.Color(0, 0, 0));
        list.setForeground(new java.awt.Color(0, 255, 0));
        list.setModel(listOfProc);
        list.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        mainpanel.setViewportView(list);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(mainpanel, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(mainpanel, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TaskManager().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JList list;
    private javax.swing.JScrollPane mainpanel;
    // End of variables declaration//GEN-END:variables

}
